/* ==============================================
1. 基础样式（全局通用，所有模块共享）
============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    min-height: 100vh;
    padding: 20px 0;
}

/* 全局容器（控制页面宽度和居中） */
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 所有模块的通用容器样式 */
.module-container {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 模块切换基础逻辑（默认隐藏，active显示） */
.module {
    display: none;
}
.module.active {
    display: block;
}

/* 所有模块的标题样式（统一风格） */
.module h2 {
    color: #2c3e50;
    border-bottom: 2px solid #4facfe;
    padding-bottom: 12px;
    margin-bottom: 25px;
    font-size: 20px;
}

/* 通用按钮样式（所有模块的按钮共享基础风格） */
button {
    border: none;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* 通用输入框样式（所有模块的输入框共享基础风格） */
input[type="text"],
input[type="file"] {
    border: 2px solid #eee;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}
input[type="text"]:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 2px rgba(79, 172, 254, 0.2);
}

/* 响应式适配（手机等小屏幕） */
@media (max-width: 768px) {
    .app-container {
        padding: 0 15px;
    }
    .module-container {
        padding: 18px;
    }
    .module h2 {
        font-size: 18px;
        margin-bottom: 20px;
    }
    button {
        padding: 8px 14px;
        font-size: 14px;
    }
}


/* ==============================================
2. 导航栏样式（顶部模块切换导航）
============================================== */
.module-nav {
    margin-bottom: 25px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 12px;
}

.module-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap; /* 小屏幕自动换行 */
    gap: 8px;
    justify-content: flex-start;
}

/* 导航按钮专属样式（区分于其他按钮） */
.module-nav button {
    background-color: #4facfe;
    color: white;
}
.module-nav button:hover {
    background-color: #00f2fe;
}

/* 导航栏响应式（小屏幕居中显示） */
@media (max-width: 768px) {
    .module-nav ul {
        justify-content: center;
    }
}


/* ==============================================
3. 待办清单模块样式（仅作用于待办模块）
============================================== */
/* 待办容器样式优化 */
.todo-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background-color: #f9fafb;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* 待办输入区优化 */
.todo-container .input-group {
    display: flex;
    gap: 12px;
    position: relative;
}

.todo-container #todo-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.todo-container #todo-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.todo-container #todo-add-btn {
    background-color: #22c55e;
    color: white;
    padding: 12px 24px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.todo-container #todo-add-btn:hover {
    background-color: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.todo-container #todo-add-btn:active {
    transform: translateY(0);
}

/* 签到按钮样式 */
#todo-checkin {
    align-self: flex-start;
    background-color: #3b82f6;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#todo-checkin:hover:not(:disabled) {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

#todo-checkin:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 待办列表样式优化 */
#todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 0;
}

#todo-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background-color: white;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

#todo-list li:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

#todo-list li.completed {
    border-left-color: #94a3b8;
    background-color: #f1f5f9;
}

#todo-list li span {
    font-size: 16px;
    color: #1e293b;
    transition: all 0.3s ease;
    flex: 1;
    margin-right: 16px;
}

#todo-list li.completed span {
    text-decoration: line-through;
    color: #94a3b8;
}

/* 待办按钮组 */
#todo-list li div {
    display: flex;
    gap: 8px;
}

/* 完成按钮样式 */
.todo-complete {
    background-color: #3b82f6;
    color: white;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.todo-complete:hover:not(:disabled) {
    background-color: #2563eb;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.todo-complete:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

/* 删除按钮样式优化 */
.todo-delete {
    background-color: #ef4444;
    color: white;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.todo-delete:hover {
    background-color: #dc2626;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

/* 空状态提示 */
#todo-list:empty::before {
    content: "还没有待办事项，添加一个吧～";
    display: block;
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 16px;
    background-color: white;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
}


/* ==============================================
4. 番茄钟模块样式（仅作用于番茄钟模块）
============================================== */
.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

/* 番茄钟显示区域 */
#timer-display {
    font-size: 60px;
    font-weight: bold;
    color: #4facfe;
    background-color: #f8f9fa;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.15);
}

/* 番茄钟按钮组 */
.timer-container .timer-btns {
    display: flex;
    gap: 15px;
}
#timer-start {
    background-color: #2ecc71;
    color: white;
}
#timer-start:hover {
    background-color: #27ae60;
}
#timer-pause {
    background-color: #f39c12;
    color: white;
}
#timer-pause:hover {
    background-color: #e67e22;
}
#timer-reset {
    background-color: #e74c3c;
    color: white;
}
#timer-reset:hover {
    background-color: #c0392b;
}
/* 番茄钟时长选择器样式 */
.timer-duration {
    margin-bottom: 15px;
    font-size: 16px;
}

.timer-duration select {
    padding: 6px 10px;
    margin-left: 10px;
    border-radius: 4px;
    border: 2px solid #eee;
    font-size: 15px;
}

/* ==============================================
5. 日历模块样式（仅作用于日历模块）
============================================== */
/* 在日历模块样式中添加 */
.calendar-day.calendar-holiday {
    color: #e74c3c; /* 节假日红色显示 */
    font-weight: bold;
    position: relative;
}

.calendar-day.calendar-holiday::after {
    content: '休';
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 8px;
    color: #e74c3c;
}
.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 日历标题（年月显示） */
#calendar-header {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    text-align: center;
    padding: 10px 0;
    background-color: #f8f9fa;
    border-radius: 6px;
}

/* 日历网格（星期+日期） */
#calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7列（周一到周日） */
    gap: 8px;
}

/* 星期标题（一到日） */
.calendar-weekday {
    text-align: center;
    font-weight: bold;
    color: #7f8c8d;
    padding: 10px 0;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* 日期格子 */
.calendar-day {
    text-align: center;
    padding: 12px 0;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.calendar-day:hover {
    background-color: #e3f2fd;
}

/* 今天日期高亮 */
.calendar-today {
    background-color: #4facfe;
    color: white;
    font-weight: bold;
}

/* 空白格子（当月第一天前/最后一天后） */
.calendar-empty {
    background-color: #f1f2f3;
    border-radius: 4px;
}


/* ==============================================
6. 数据统计模块样式（仅作用于数据统计模块）
============================================== */
.stats-container {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

/* 图表容器（确保图表自适应） */
#stats-chart {
    width: 100% !important;
    height: auto !important;
    max-height: 400px;
}


/* ==============================================
7. 天气查询模块样式（仅作用于天气模块）
============================================== */
.weather-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 天气输入区（输入框+查询按钮） */
.weather-container .input-group {
    display: flex;
    gap: 12px;
}
#weather-city {
    flex: 1;
}
#weather-search {
    background-color: #4facfe;
    color: white;
}
#weather-search:hover {
    background-color: #00f2fe;
}

/* 天气结果显示区 */
#weather-result {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 10px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    text-align: center;
}
#weather-result.show {
    opacity: 1;
    transform: translateY(0);
}

/* 天气图标 */
.weather-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px;
}

/* 天气标题（城市+实时天气） */
#weather-result h3 {
    color: #2c3e50;
    font-size: 19px;
    margin-bottom: 20px;
}

/* 天气详情列表 */
.weather-detail {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 16px;
    color: #555;
}

/* 天气错误提示 */
.weather-error {
    color: #e74c3c;
    font-size: 16px;
    padding: 30px 0;
}


/* ==============================================
8. 本地音乐模块样式（仅作用于音乐模块）
============================================== */
.music-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 音乐文件选择 */
#music-file {
    padding: 12px;
    background-color: #f8f9fa;
    cursor: pointer;
}

/* 音频播放器 */
#music-player {
    width: 100%;
    height: 50px;
    border: none;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 5px;
}

/* 音乐控制按钮组 */
.music-container .music-btns {
    display: flex;
    gap: 12px;
}
#music-play {
    background-color: #2ecc71;
    color: white;
}
#music-play:hover {
    background-color: #27ae60;
}
#music-pause {
    background-color: #f39c12;
    color: white;
}
#music-pause:hover {
    background-color: #e67e22;
}


/* ==============================================
9. 贪吃蛇模块样式（仅作用于贪吃蛇模块）
============================================== */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* 贪吃蛇画布 */
#snake-canvas {
    width: 400px;
    height: 400px;
    border: 3px solid #4facfe;
    border-radius: 8px;
    background-color: #f8f9fa;
    display: block;
    margin: 0 auto;
}

/* 贪吃蛇控制区（分数+按钮） */
.snake-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* 分数显示 */
.snake-controls p:first-child {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}
#snake-score {
    color: #4facfe;
}

/* 贪吃蛇按钮组 */
.snake-controls .snake-btns {
    display: flex;
    gap: 12px;
}
#snake-start {
    background-color: #2ecc71;
    color: white;
}
#snake-start:hover {
    background-color: #27ae60;
}
#snake-pause {
    background-color: #f39c12;
    color: white;
}
#snake-pause:hover {
    background-color: #e67e22;
}
#snake-reset {
    background-color: #e74c3c;
    color: white;
}
#snake-reset:hover {
    background-color: #c0392b;
}

/* 操作提示 */
.snake-tips {
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 5px;
}

/* 俄罗斯方块容器 */
.tetris-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

#tetris-canvas {
    background-color: #716e6e;
    border: 2px solid #4facfe;
    border-radius: 4px;
}

.tetris-info {
    text-align: center;
    color: #333;
}

.tetris-info button {
    margin: 0 5px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    /* background-color: #4facfe; */
    color: white;
    transition: background-color 0.2s;
}

/* .tetris-info button:hover {
    background-color: #3a8fde;
} */

#tetris-start {
    background-color: #2ecc71;
    color: white;
}
#tetris-start:hover {
    background-color: #27ae60;
}
#tetris-pause {
    background-color: #f39c12;
    color: white;
}
#tetris-pause:hover {
    background-color: #e67e22;
}
#tetris-reset {
    background-color: #e74c3c;
    color: white;
}
#tetris-reset:hover {
    background-color: #c0392b;
}

.tetris-info p {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

/* 游戏选择器样式 */
.game-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.game-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    background-color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-btn.active {
    background-color: #4facfe;
    color: white;
}

/* 游戏内容容器 */
.game-content {
    position: relative;
    
    min-height: 450px; /* 确保切换时高度稳定 */
}

/* 单个游戏项样式 */
.game-item {
    display: none;
    animation: fadeIn 0.5s ease;
}

.game-item.active {
    display: block;
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 提醒面板 */
.reminder-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    padding: 12px 16px;
    z-index: 1000;
    border-left: 4px solid #f39c12;
    display: none; /* 默认隐藏 */
}

.reminder-panel h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

.reminder-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.reminder-list p {
    margin: 4px 0;
    font-size: 14px;
    color: #555;
    padding-left: 12px;
    position: relative;
}

.reminder-list p::before {
    content: "•";
    color: #f39c12;
    position: absolute;
    left: 0;
}

#reminder-close {
    width: 100%;
    padding: 6px;
    background-color: #f1f1f1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#reminder-close:hover {
    background-color: #e5e5e5;
}